-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Core: suspend auctions during prerendering #12763
Conversation
lgtm, can we document |
src/prebid.js
Outdated
pbjsInstance.processQueue = delayIfPrerendering(function () { | ||
pbjsInstance.que.push = pbjsInstance.cmd.push = quePush; | ||
insertLocatorFrame(); | ||
hook.ready(); | ||
processQueue(pbjsInstance.que); | ||
processQueue(pbjsInstance.cmd); | ||
}; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @dgirardi I have a question, since now the processQueue
is called when the prebid instance is ready, introducing this change will introduce the delay of all the queues, right?
I understood that the delay was actually only related to the requestBids
, and this seems fantastic because we can execute everything in the prerendering "phase" and then firing only the auctions when the user actually views the page.
Can you tell me if I'm wrong? Sorry in advance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good suggestion. I defaulted to delaying everything because it seemed safer, but we couldn't think of an example of something that would break if we delayed only auctions. Updated.
Type of change
Description of change
If the document is being prerendered, delay auctions until the page is activated.
Other information
Closes #12724